import Vue from 'vue'
import Vuex from 'vuex'
import mutations from './mutation'
import actions from './action'
import getters from './getters'
Vue.use(Vuex)

// 创建store对象
function getCar() {
    return JSON.parse(localStorage.getItem('car') || '[]');
}
let state = {
    carList: getCar()
}
const store = new Vuex.Store({
    state,
    getters,
    mutations,
    actions
})
export default store
